home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / love4th.zip / MEMGRAPH.DOC < prev    next >
Text File  |  1991-10-01  |  8KB  |  180 lines

  1.                L.O.V.E. FORTH Interactive System Map
  2.  
  3. relative address                  description          actual segment
  4.  
  5. 0000:0000       ┌───────────┐     DOS PSP              GET:PSP or GET:CS
  6. 0000:0100       ├───────────┤
  7.                 │           │     CODE SEGMENT                
  8.                 ├─ CS:HERE ─┤
  9.                 │           │
  10.                 │           │
  11.                 │           │
  12.                 │           │
  13.                 │ virtual │
  14. 1000:0000       ╞═══════════╡
  15.                 │           │     THREAD SEGMENT       GET:TS
  16.                 │           │
  17.                 ├─ TS:HERE ─┤
  18.                 │           │
  19.                 │           │
  20.                 │           │
  21.                 │           │
  22.                 │ ^virtual^ │
  23. 2000:0000       ╞═══════════╡     DATA (VARIABLES)     GET:VS
  24.                 │           │     SEGMENT
  25.                 ├── HERE ───┤
  26.         HERE+54h├── PAD  ───┤      
  27.                 │           │
  28.                 │           │
  29.                 │ ^virtual^ │
  30.                 ├─ FIRST ───┤
  31.                 │  LIMIT    │ block buffers
  32. 3000:0000       ╞═══════════╡    
  33.                 │           │     HEAD SEGMENT         GET:HS
  34.                 │           │
  35.                 │           │
  36.                 ├─ HS:HERE ─┤
  37.                 │           │
  38.                 │           │
  39.                 │           │
  40.                 │ ^virtual^ │
  41. 4000:0000       ╞═══════════╡
  42.                 ├─ SS:HERE ─┤     STACK SEGMENT        GET:SS
  43.                 │           │
  44.                 │           │
  45.                 │           │
  46.                 │           │
  47. 4000:DFF0       ├───────────┤ ^vocabulary stack   (initial addresses
  48. 4000:EFF0       ├─ RPBOT ───┤ ^return stack                given)
  49. 4000:FFF0       ├─ SPBOT ───┤ ^parameter stack
  50. 5000:0000       ╞═══════════╡
  51.                 │           │     HEAP SEGMENT         GET:HEAP
  52.                 │           │
  53.                 /           /
  54.                 │           │ at least MINHEAP 
  55.                 └───────────┘    paragraphs
  56.  
  57.    Notes: * GET:CS and GET:PSP return the same segment on version 1.28
  58.             and prior versions
  59.           * ^virtual^ vocabularies are at the top of memory, if present
  60.           * stacks work downward from high memory
  61.  
  62.                L.O.V.E. FORTH APPLICATION Map
  63.  
  64. relative address                  description          actual segment
  65.  
  66. 0000:0000       ┌───────────┐     DOS PSP              GET:PSP  GET:CS
  67. 0000:0100       ├───────────┤
  68.                 │           │     CODE SEGMENT                
  69.                 ├─ CS:HERE ─┤
  70. ????:0000       ╞═══════════╡
  71.                 │           │     THREAD SEGMENT       GET:TS
  72.                 │           │
  73.                 ├─ TS:HERE ─┤
  74. ????:0000       ╞═══════════╡     DATA (VARIABLES)     GET:VS
  75.                 │           │     SEGMENT
  76.                 ├── HERE ───┤
  77.         HERE+54h├── PAD  ───┤      
  78.          PAD+50h├─ FIRST ───┤
  79.                 │  LIMIT    │ block buffers
  80. ????:0000       ╞═══════════╡     
  81.                 ├─ SS:HERE ─┤     STACK SEGMENT        GET:SS
  82. ????:SS:HERE    ├───────────┤
  83. ????:  "  +1000h├─ RPBOT ───┤ ^return stack       
  84. ????:  "  +2000h├─ SPBOT ───┤ ^parameter stack    
  85. ????:0000       ╞═══════════╡                     
  86.                 │           │     HEAP SEGMENT         GET:HEAP
  87.                 │           │
  88.                 /           /
  89.                 │           │ at least MINHEAP 
  90.                 └───────────┘    paragraphs
  91.  
  92. Notes: * segments are packed to the nearest paragraph above their 
  93.            respective xx:HERE
  94.        * GET:HS and HS:HERE are undefined
  95.        * vocabulary stack does not exist
  96.        * return and parameter stacks are allocated above SS:HERE 
  97.  
  98.                     Segmentation Examples
  99.  
  100. Notes: * all addresses are 16 bits (cell)
  101.        * head segment can be eliminated from applications
  102.        * head segment form is subject to change in future versions
  103.  
  104.    CODE Word Example
  105.  
  106.         ┌────/─┬─────────────────────────┬───────────────────────/──┐
  107.    CS:  │      │ ..code .. code .. [next]│                          │
  108.         └────/─┴─────────────────────────┴───────────────────────/──┘
  109.                ^address xxxx
  110.  
  111.         ┌────/─┬────┬────────────────────────────────────────────/──┐
  112.    TS:  │      │xxxx│                                               │
  113.         └────/─┴────┴────────────────────────────────────────────/──┘
  114.                ^ compilation address yy
  115.                  (cell points to code)
  116.                                                 (VS: not relavent)
  117.  
  118.         ┌────/─╥────┬─────────┬──┬────┬──╥───────────────────────/──┐
  119.    HS:  │      ║link│cnt name │yy│xxxx│  ║                          │
  120.         └────/─╨────┴─────────┴──┴────┴──╨───────────────────────/──┘
  121.                     ^         ^pointers to code, compilation addr, etc
  122.                     ^name field address
  123.  
  124.    COLON Word Example
  125.  
  126.         ┌────/─┬─────────────────────────────┬───────────────────/──┐
  127.    CS:  │      │ colon nesting code .. [next]│                      │
  128.         └────/─┴─────────────────────────────┴───────────────────/──┘
  129.                ^address *col*
  130.                       Nesting code is common to all colon words.
  131.  
  132.         ┌─╥──╥───╥─╥─/───╥─────┬────┬────┬────╥──────────────────/──┐
  133.    TS:  │ ║  ║   ║ ║     ║*col*│ zz │ pp │EXIT║                     │
  134.         └─╨──╨───╨─╨─/───╨─────┴────┴────┴────╨──────────────────/──┘
  135.           ^pp    ^zz     ^compilation address qq
  136.                           (points to code)
  137.  
  138.                 pp, zz  compilation addresses of other words (cell)
  139.                 EXIT    compilation address of EXIT
  140.  
  141.                                                   (VS: not relavent)
  142.  
  143.         ┌────/─╥────┬─────────┬──┬───┬──╥────────────────────────/──┐
  144.    HS:  │      ║link│cnt name │qq│   │  ║                           │
  145.         └────/─╨────┴─────────┴──┴───┴──╨────────────────────────/──┘
  146.                     ^         ^pointers to code, compilation addr, etc
  147.                     ^name field address
  148.  
  149.    VARIABLE Example
  150.  
  151.    Note: A VARIABLE or CREATEd word is really just a CONSTANT that 
  152.          returns an address
  153.  
  154.         ┌────/─┬───────────────────────┬─────────────────────────/──┐
  155.    CS:  │      │ constant code.. [next]│                            │
  156.         └────/─┴───────────────────────┴─────────────────────────/──┘
  157.                ^address *con*
  158.                       Constant code is common to all CONSTANTs,
  159.                                 VARIABLEs and CREATEd words
  160.  
  161.         ┌───────/───╥─────┬────╥─────────────────────────────────/──┐
  162.    TS:  │           ║*con*│aaaa║                                    │
  163.         └───────/───╨─────┴────╨─────────────────────────────────/──┘
  164.                     ^     ^thread segment parameter field
  165.                     ^       aaaa = CONSTANT data or VARIABLE address
  166.                     ^compilation address vv
  167.                        (points to code)
  168.  
  169.         ┌───────/───────╥────────────────────────────╥───────────/──┐
  170.    VS:  │               ║  ... ALLOTed data space .. ║              │
  171.         └───────/───────╨────────────────────────────╨───────────/──┘
  172.                         aaaa
  173.  
  174.  
  175.         ┌────/─╥────┬─────────┬──┬──┬────╥────────────────────────/──┐
  176.    HS:  │      ║link│cnt name │vv│  │aaaa║                           │
  177.         └────/─╨────┴─────────┴──┴──┴────╨────────────────────────/──┘
  178.                     ^         ^pointers to code, compilation addr, etc
  179.                     ^name field address
  180.